using System;
using System.Web.UI;

namespace ValidationFramework.Web.ASP
{
    /// <summary>
    /// A <see cref="AutoKeyDictionary{TKey,TItem}"/> of <see cref="ValidationAssociation"/>s.
    /// </summary>
    [Serializable]
    public sealed class ValidationAssociationCollection : AutoKeyDictionary<Control, ValidationAssociation>
    {
        #region Methods

		/// <inheritdoc />
        protected override Control GetKeyForItem(ValidationAssociation item)
        {
            Guard.ArgumentNotNull(item, "item");
            return item.ControlToValidate;
        }

        #endregion
    }
}